import { EventEmitter } from 'events';
import Scene from '../Scene';

export default class Sizes extends EventEmitter {
    constructor(container){
        super();
        this.width = container.offsetWidth;
        this.height = container.offsetHeight;
        this.aspect = this.width / this.height;
        this.frustrum = 5;
        this.pixelRatio = Math.min(window.devicePixelRatio, 2);
        window.addEventListener('resize', ()=>{
            this.width = container.offsetWidth;
            this.height = container.offsetHeight;
            this.aspect = this.width / this.height;
            this.pixelRatio = Math.min(window.devicePixelRatio, 2);
            this.emit('resize');
        })
    }
}